package com.js.basic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.js.basic.mapper.BsContractMapper;
import com.js.basic.domain.BsContract;
import com.js.basic.service.IBsContractService;

/**
 * 合同Service业务层处理
 * 
 * @author lzq
 * @date 20240709
 */
@Service
public class BsContractServiceImpl implements IBsContractService 
{
    @Autowired
    private BsContractMapper bsContractMapper;

    /**
     * 查询合同
     * 
     * @param contractCode 合同主键
     * @return 合同
     */
    @Override
    public BsContract selectBsContractByContractCode(String contractCode)
    {
        return bsContractMapper.selectBsContractByContractCode(contractCode);
    }

    /**
     * 查询合同列表
     * 
     * @param bsContract 合同
     * @return 合同
     */
    @Override
    public List<BsContract> selectBsContractList(BsContract bsContract)
    {
        return bsContractMapper.selectBsContractList(bsContract);
    }

    /**
     * 新增合同
     * 
     * @param bsContract 合同
     * @return 结果
     */
    @Override
    public int insertBsContract(BsContract bsContract)
    {
        bsContract.setCreateTime(DateUtils.getNowDate());
        return bsContractMapper.insertBsContract(bsContract);
    }

    /**
     * 修改合同
     * 
     * @param bsContract 合同
     * @return 结果
     */
    @Override
    public int updateBsContract(BsContract bsContract)
    {
        return bsContractMapper.updateBsContract(bsContract);
    }

    /**
     * 批量删除合同
     * 
     * @param contractCodes 需要删除的合同主键
     * @return 结果
     */
    @Override
    public int deleteBsContractByContractCodes(String[] contractCodes)
    {
        return bsContractMapper.deleteBsContractByContractCodes(contractCodes);
    }

    /**
     * 删除合同信息
     * 
     * @param contractCode 合同主键
     * @return 结果
     */
    @Override
    public int deleteBsContractByContractCode(String contractCode)
    {
        return bsContractMapper.deleteBsContractByContractCode(contractCode);
    }
}
